package com.example.testdb2.mapper;

import com.example.testdb2.entity.UserInfo;
import com.example.testdb2.entity.dto.UserInfoPageDto;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    void add(UserInfo userInfo);

    @Select("select * from `user_info`")
    List<UserInfo> list();

    void updateById(UserInfo userInfo);

    @Delete("delete from `user_info` where id=#{id}")
    void deleteById(Long id);

    Page pageList(UserInfoPageDto userInfoPageDto);
}
